package entity;

import org.springframework.context.ApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

public class MoAttack {
    public void cityGateAsk(){
        ApplicationContext applicationContext = new ClassPathXmlApplicationContext("work7.xml");
        //获取4个不同方式注入的bean
        LiuDeHualdh ldh1 = (LiuDeHualdh) applicationContext.getBean("ldh1");
        System.out.println(ldh1);
        LiuDeHualdh ldh2 = (LiuDeHualdh) applicationContext.getBean("ldh2");
        System.out.println(ldh2);
        LiuDeHualdh ldh3 = (LiuDeHualdh) applicationContext.getBean("ldh3");
        System.out.println(ldh3);
        LiuDeHualdh ldh4 = (LiuDeHualdh) applicationContext.getBean("ldh4");
        System.out.println(ldh4);
        ldh1.responseAsk("墨者革离");
    }

    public static void main(String[] args) {
        MoAttack moAttack = new MoAttack();
        moAttack.cityGateAsk();
    }

}
